
export default function(Vue, options) {
  Vue.prototype.$getDict = function (type) {
    return new Promise((resolve, reject) => {
      this.$axios({
        url: '/getCode',
        method: "get",
        params:{
          dictType: type
        }
      }).then((res) =>{
          resolve(res.data.data)
        },
        (err)=>{
          reject(err.json())
        })
    } )
  };
  Vue.prototype.$getDictLabel = function (value,list){
    for (let i = 0; i < list.length; i++) {
      if (list[i].dictValue === value){
        return list[i].dictLabel;
      }
    }
  } ;
};
